﻿using System;
using System.Data;
using System.Collections;
using System.Configuration;
using MJHDataService;
/// <summary>
/// Summary description for Measurement
/// </summary>
public class Measurement : IDisposable
{
    private bool disposed = false;
    private SqlDataService oSvc;

    public Measurement()
    {
        oSvc = new SqlDataService(ConfigurationManager.ConnectionStrings["NuTraxDB"].ConnectionString);
    }

    public DataTable GetMeasurementUnits()
    {
        return GetMeasurementUnits(new Hashtable());
    }
    public DataTable GetMeasurementUnits(Int16 measurementTypeID)
    {
        Hashtable oParam = new Hashtable();
        oParam.Add("MeasurementTypeID", measurementTypeID);
        return GetMeasurementUnits(oParam);
    }
    public DataTable GetMeasurementUnits(Hashtable oParam)
    {
        return oSvc.ExecuteProcedureReturnDS("MeasurementUnit_Read_List", oParam).Tables[0];
    }
    #region IDisposable Members

    private void Dispose(bool disposing)
    {
        if (!disposed)
        {
            if (disposing)
            {
                oSvc.Dispose();
            }
            disposed = true;
        }
    }
    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }
    ~Measurement()
    {
        Dispose(false);
    }

    #endregion
}
